package com.bpr.webservice.domain;

import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;

import com.fasterxml.jackson.annotation.JsonIgnore;

import lombok.Data;


@Entity
public class Usergroups {

	@Id
    @SequenceGenerator(name="usergroups_groupid",sequenceName="usergroupid_seq", allocationSize=1)
    @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="usergroups_groupid")
    @Basic(optional = false)
    @Column(name = "usergroupid")
    private Long usergroupid;
    @Basic(optional = false)
    @Column(name = "usergroupname")
    private String usergroupname;
    @JsonIgnore
    @OneToMany(mappedBy = "usergroupid", fetch = FetchType.LAZY, cascade = CascadeType.MERGE)
    private List<Users> usersList;
	public Usergroups() {
		super();
		// TODO Auto-generated constructor stub
	}
	public Long getUsergroupid() {
		return usergroupid;
	}
	public void setUsergroupid(Long usergroupid) {
		this.usergroupid = usergroupid;
	}
	public String getUsergroupname() {
		return usergroupname;
	}
	public void setUsergroupname(String usergroupname) {
		this.usergroupname = usergroupname;
	}
	public List<Users> getUsersList() {
		return usersList;
	}
	public void setUsersList(List<Users> usersList) {
		this.usersList = usersList;
	}
    
    
    
}
